<template>
	<el-tabs type="border-card"  v-model="activeTag" @click="changeTag()" >
		<el-tab-pane label="逐笔记录" name="0">			
			<el-row>
				<!-- 按日期搜索 -->
				<el-col :xs="24" :sm="12" :md="14" :lg="12" :xl="12">
					<div class="demo-date-picker">
					    <div class="block">
					      <el-date-picker  
						  size="default" style="width:10.125rem;"
						   v-model="detailDayTime" placeholder="点击按日期查询"
						   type="date"
						   value-format="YYYY-MM-DD"
							>
					      </el-date-picker>	
							<el-button
								@click="subGetDetailDayByTime"
								class="xs-button"
								type="primary"
								style="margin-left: 0.3125rem;">
								搜索
							</el-button>
					    </div>
					  </div>
				</el-col>
				<el-col :xs="24" :sm="12" :md="10" :lg="12" :xl="12">
					 <el-input class="input1"
						v-model="detailDayHeader"
						type="text"
						placeholder="按名称查询" />
					<el-button 
						class="xs-button"
						@click="subGetDetailDayByName"
						type="primary"
						style="margin-left: 0.3125rem;">
					   搜索
					</el-button>
				</el-col>
			</el-row>
			<el-table :data="tableData" style="width:100% ;text-align:center;" max-height="440">
			    <el-table-column prop="detailTime" label="时间" width="120" />
			    <el-table-column prop="detailProjectName" label="工程名称" width="210" />
			    <el-table-column prop="detailProjectPice" label="工程报价" width="120" />
			    <el-table-column prop="detailProjectCost" label="成本" width="120" />
			    <el-table-column prop="detailProjectProfit" label="利润" width="120" />
				<el-table-column prop="detailIsOk" label="发票已送" width="100" />
			    <el-table-column prop="detailProjectHeader" label="负责人" width="110" />
				<el-table-column prop="detailPlace" label="位置" width="220" />
			    <el-table-column label="操作" width="60">
					<template #default="scope">
						<el-button  size="small"  @click="dialogGetInfor(scope.row) ,dialogFormVisible = true">
							修改
						</el-button>
			      </template>
			    </el-table-column>
			</el-table>
			<!-- 分页 -->
			<el-row>
			    <el-col :span="24" style="text-align: center;">
						<el-pagination								
						      v-model:currentPage="queryInfo.pagenum"
						      :page-size="queryInfo.pagesize"
						      layout="prev, pager, next"
						      :total="queryInfo.total"
						      @size-change="handleSizeChange"
						      @current-change="handleCurrentChange"
						    >
						    </el-pagination>
				</el-col>
			</el-row>
			
		</el-tab-pane>
		
		<el-tab-pane label="日账单" name="1">
			<el-row>
				<!-- 按日期搜索 -->
				<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
					<div class="demo-date-picker">
					    <div class="block">
					      <el-date-picker  
						  size="default" style="width:10.375rem;"
						   v-model="dayTime" placeholder="点击按日期查询"
						   type="date"
						   value-format="YYYY-MM-DD"
						   >
					      </el-date-picker>
						  <el-button
						  	@click="subGetDayByTime"
						  	class="xs-button"
						  	type="primary"
						  	style="margin-left: 0.3125rem;">
						  	搜索
						  </el-button>
					    </div>
					  </div>
				</el-col>

			</el-row>
			<el-table :data="tableDayData" style="width:100% ;text-align:center;" max-height="440">
			    <el-table-column prop="time" label="时间" width="150" />
			    <el-table-column prop="projectProfit" label="净利润" width="170" />
			    <el-table-column prop="projectIncome" label="总收入" width="170" />
			    <el-table-column prop="projectCost" label="总支出" width="170" />
				<el-table-column prop="projectNumber" label="工程数量" width="102" />
			    <el-table-column prop="tax" label="税务" width="130" />
				<el-table-column prop="note" label="备注" width="220" />
			    <el-table-column label="操作" width="60">
					<template #default="scope">
						<el-button  size="small"  @click="dialogGetDayInfor(scope.row),dayDialogFormVisible=true">
							修改
						</el-button>
			      </template>
			    </el-table-column>
			</el-table>
			<!-- 分页 -->
			<el-row>
			    <el-col :span="24" style="text-align: center;">
						<el-pagination
						      v-model:currentPage="queryDayInfo.pagenum"
						      :page-size="queryDayInfo.pagesize"
						      layout="prev, pager, next"
						      :total="queryDayInfo.total"
						      @size-change="handleSizeChangeByDay"
						      @current-change="handleCurrentChangeByDay"
						    >
						    </el-pagination>
				</el-col>
			</el-row>
		</el-tab-pane>
		
		<el-tab-pane label="周账单" name="2">
			<el-row>
				<!-- 按日期搜索 -->
				<el-col :xs="11" :sm="10" :md="14" :lg="12" :xl="12">
					<div class="demo-date-picker">
					    <div class="block">
					      <el-date-picker  
						  size="default" style="width:10.375rem;"
						   v-model="weekTime" placeholder="点击按周查询"
						   type="week">
					      </el-date-picker>
					    </div>
					  </div>
				</el-col>
			</el-row>
			<el-table :data="tableWeekData" style="width:100% ;text-align:center;" max-height="440">
			    <el-table-column prop="time" label="时间" width="150" />
			    <el-table-column prop="projectProfit" label="净利润" width="205" />
			    <el-table-column prop="projectIncome" label="总收入" width="205" />
			    <el-table-column prop="projectCost" label="总支出" width="205" />
				<el-table-column prop="projectNumber" label="工程数量" width="205" />
			    <el-table-column prop="tax" label="税务" width="205" />
			</el-table>
			<!-- 分页 -->
			<el-row>
			    <el-col :span="24" style="text-align: center;">
						<el-pagination
						      v-model:currentPage="queryWeekInfo.pagenum"
						      :page-size="queryWeekInfo.pagesize"
						      layout="prev, pager, next"
						      :total="queryWeekInfo.total"
						      @size-change="handleSizeChangeByWeek"
						      @current-change="handleCurrentChangeByWeek"
						    >
						</el-pagination>
				</el-col>
			</el-row>
		</el-tab-pane>
		
		<el-tab-pane label="月账单" name="3">
			<el-row>
				<!-- 按日期搜索 -->
				<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
					<div class="demo-date-picker">
					    <div class="block">
					      <el-date-picker  
						  size="default" style="width:10.375rem;"
						  value-format="YYYY-MM"
						   v-model="monthTime" placeholder="点击按月查询"
						   type="month">
					      </el-date-picker>
						  <el-button
						  	@click="subGetMonthByTime()"
						  	class="xs-button"
						  	type="primary"							
						  	style="margin-left: 0.3125rem;">
						  	搜索
						  </el-button>
					    </div>
					  </div>
				</el-col>
			</el-row>
			<el-table :data="tableMonthData" style="width:100% ;text-align:center;" max-height="440">
			    <el-table-column prop="time" label="时间" width="150" />
			    <el-table-column prop="projectProfit" label="净利润" width="205" />
			    <el-table-column prop="projectIncome" label="总收入" width="205" />
			    <el-table-column prop="projectCost" label="总支出" width="205" />
				<el-table-column prop="projectNumber" label="工程数量" width="205" />
			    <el-table-column prop="tax" label="税务" width="205" />
			</el-table>
			<!-- 分页 -->
			<el-row>
			    <el-col :span="24" style="text-align: center;">
						<el-pagination
						      v-model:currentPage="queryMonthInfo.pagenum"
						      :page-size="queryMonthInfo.pagesize"
						      layout="prev, pager, next"
						      :total="queryMonthInfo.total"
						      @size-change="handleSizeChangeByMonth"
						      @current-change="handleCurrentChangeByMonth"
						    >
						</el-pagination>
				</el-col>
			</el-row>
		</el-tab-pane>
		
		<el-tab-pane label="年账单" name="4">
			<el-row>
				<!-- 按日期搜索 -->
				<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
					<div class="demo-date-picker">
					    <div class="block">
					      <el-date-picker  
						  size="default" style="width:10.375rem;"
						   v-model="yearTime" placeholder="点击按年查询"
						   value-format="YYYY"
						   type="year">
					      </el-date-picker>
						  <el-button
						  	@click="subGetYearByTime()"
						  	class="xs-button"
						  	type="primary"
						  	style="margin-left: 0.3125rem;">
						  	搜索
						  </el-button>
					    </div>
					  </div>
				</el-col>
			</el-row>
			<el-table :data="tableYearData" style="width:100% ;text-align:center;" max-height="440">
			    <el-table-column prop="time" label="时间" width="150" />
			    <el-table-column prop="projectProfit" label="净利润" width="205" />
			    <el-table-column prop="projectIncome" label="总收入" width="205" />
			    <el-table-column prop="projectCost" label="总支出" width="205" />
			    <el-table-column prop="growth" label="增长情况" width="205" />
				<el-table-column prop="projectNumber" label="工程数量" width="205" />
			</el-table>
			<!-- 分页 -->
			<el-row>
			    <el-col :span="24" style="text-align: center;">
						<el-pagination
						      v-model:currentPage="queryYearInfo.pagenum"
						      :page-size="queryYearInfo.pagesize"
						      layout="prev, pager, next"
						      :total="queryYearInfo.total"
						      @size-change="handleSizeChangeByYear"
						      @current-change="handleCurrentChangeByYear"
						    >
						</el-pagination>
				</el-col>
			</el-row>
		</el-tab-pane>
	
		<el-tab-pane label="逐笔数据录入" name="5">
			<!-- 逐笔录入 -->
			<el-row>
			    <el-col  :xs="24" :sm="16" :md="16" :lg="12" :xl="12" style="text-align: center;">
					<div style="margin:10px;margin-top: 30px;"></div>
					  <el-form
						size="80"
					    :label-position="top"
					    label-width="80px"
					    :model="insertDetailDataForm"
					    style=" text-align: center;width: 455px;height: 28.4375rem;"
					  >
					    <el-form-item label="时间">
							<el-date-picker 							
								v-model="insertDetailDataForm.detailTime" 
								type="date" placeholder="选择时间" 
								style="width: 8.5rem;">
							</el-date-picker>							
							<el-select v-model="insertDetailDataForm.weight" 
							class="m-2" placeholder="加权选项" 
							size="default"
							style="width: 100px;"
							>
							    <el-option
							      v-for="item in options"
							      :key="item.value"
							      :label="item.label"
							      :value="item.value"
							    >
							    </el-option>
							  </el-select>
						</el-form-item>
					    
						<el-form-item label="工程名称">
					      <el-input v-model="insertDetailDataForm.detailProjectName"></el-input>
					    </el-form-item>
					    <el-form-item label="工程报价">
					      <el-input v-model="insertDetailDataForm.detailProjectPice"></el-input>
					    </el-form-item>
						<el-form-item label="成本" >
						  <el-input v-model="insertDetailDataForm.detailProjectCost"></el-input>
						</el-form-item>
						<el-form-item label="发票已送">
						  <el-input v-model="insertDetailDataForm.detailIsOk"></el-input>
						</el-form-item>
						<el-form-item label="负责人" >
						  <el-input v-model="insertDetailDataForm.detailProjectHeader"></el-input>
						</el-form-item>
						<el-form-item label="位置" >
						  <el-input v-model="insertDetailDataForm.detailPlace"></el-input>
						</el-form-item>
						<el-button type="primary" @click="subDetailData()">提交</el-button>
					</el-form>
				</el-col>
				
			</el-row>  
		</el-tab-pane>
		<el-tab-pane label="单日数据录入"  name="6">
			<el-row>
			    <el-col  :xs="24" :sm="8" :md="8" :lg="12" :xl="12" style="text-align: center;">
					<div style="margin:10px; margin-top: 30px;"></div>
					  <el-form
						size="140"
					    :label-position="top"
					    label-width="80px"
					    :model="insertDayDataForm"
					    style=" text-align: center;width: 455px;height: 28.4375rem;"
					  >
					    <el-form-item label="时间">
					      <el-date-picker v-model="insertDayDataForm.time" type="date" placeholder="选择日期">
					      </el-date-picker>
					    </el-form-item>
					    <el-form-item label="总收入">
					      <el-input v-model="insertDayDataForm.projectIncome"></el-input>
					    </el-form-item>
						<el-form-item label="总支出">
						  <el-input v-model="insertDayDataForm.projectCost"></el-input>
						</el-form-item>
						<el-form-item label="工程数量">
						  <el-input v-model="insertDayDataForm.projectNumber"></el-input>
						</el-form-item>
						<el-form-item label="税务">
						  <el-input v-model="insertDayDataForm.tax"></el-input>
						</el-form-item>
						<el-form-item label="备注">
						  <el-input v-model="insertDayDataForm.note"></el-input>
						</el-form-item>
						<el-button type="primary" @click="subDayData()">提交</el-button>
					</el-form>
				</el-col>
				<el-col :xs="0" :sm="12" :md="12" :lg="12" :xl="12">					
				</el-col>		
			</el-row>   
		</el-tab-pane>
	</el-tabs>
	
	<!-- 表单内容 -->
	<!-- 逐笔修改 -->
	<el-dialog v-model="dialogFormVisible" title="你可以在此修改数据" width='300px' top='6vh'>
		<el-form :model="tableUpdateData" style="width:15rem">    		
			<el-form-item label="时间">
			  <el-date-picker v-model="tableUpdateData.detailTime" 
			  value-format="YYYY-MM-DD" type="date" placeholder="Pick a day">
			  </el-date-picker>
			</el-form-item>
			<el-form-item label="工程名称">
			  <el-input v-model="tableUpdateData.detailProjectName" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="工程报价">
			  <el-input v-model="tableUpdateData.detailProjectPice" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="成本">
			  <el-input v-model="tableUpdateData.detailProjectCost" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="利润">
			  <el-input v-model="tableUpdateData.detailProjectProfit" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="发票已送">
			  <el-input v-model="tableUpdateData.detailIsOk" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="负责人">
			  <el-input v-model="tableUpdateData.detailProjectHeader" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="位置">
			  <el-input v-model="tableUpdateData.detailPlace" :label-width="formLabelWidth"></el-input>
			</el-form-item>
		</el-form>
	    		
		<template #footer >
	      <span class="dialog-footer">
	        <el-button @click="dialogFormVisible = false" >取消</el-button>
	        <el-button type="primary" @click="dialogFormVisible = false,subDetailUpdate()"
	          >提交</el-button
	        >
	      </span>
	    </template>
	</el-dialog>
	<!-- 日修改 -->
	<el-dialog v-model="dayDialogFormVisible" title="你可以在此修改数据" width='300px' top='6vh'>
		<el-form :model="tableUpdateDayData" style="width:15rem">    		
			<el-form-item label="时间">
			  <el-date-picker v-model="tableUpdateDayData.time"  value-format="YYYY-MM-DD" type="date">
			  </el-date-picker>
			</el-form-item>
			<el-form-item label="净利润">
			  <el-input v-model="tableUpdateDayData.projectProfit" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="总收入">
			  <el-input v-model="tableUpdateDayData.projectIncome" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="总支出">
			  <el-input v-model="tableUpdateDayData.projectCost" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="工程数量">
			  <el-input v-model="tableUpdateDayData.projectNumber" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="税务">
			  <el-input v-model="tableUpdateDayData.tax" :label-width="formLabelWidth"></el-input>
			</el-form-item>
			<el-form-item label="备注">
			  <el-input v-model="tableUpdateDayData.note" :label-width="formLabelWidth"></el-input>
			</el-form-item>
		</el-form>
	    		
		<template #footer >
	      <span class="dialog-footer">
	        <el-button @click="dayDialogFormVisible = false" >取消</el-button>
	        <el-button type="primary" @click="subDayUpdate(), dayDialogFormVisible = false"
	          >提交</el-button
	        >
	      </span>
	    </template>
	</el-dialog>
	
</template>

<script  lang="ts" setup>
	import { ref } from 'vue'	
	import { onMounted,reactive } from 'vue'	
	import { ElMessageBox,ElMessage } from 'element-plus'
	import { ArrowDown } from '@element-plus/icons-vue'
	import { getDetailData,getDetailDataByTime,
	getDetailDayByHeader,getDayData,
	getDayDataByTime,
	getWeekData,getWeekDataByTime,
	getMonthData,getMonthDataByTime,
	getYearData,getYearDataByTime,
	updateDetailData,
	updateDayData,insertDetailData,
	insertDayData} from "../../http/dataEntry.js"

	//锁定标签页
	const activeTag = ref('')		
	if (sessionStorage.getItem("activeTag")!=null) {
		activeTag.value = sessionStorage.getItem("activeTag")
	} 
	const changeTag = () => {
		sessionStorage.setItem("activeTag",activeTag.value);
	}
		// 日期
	const shortcuts = [
	  {
	    text: 'Today',
	    value: new Date(),
	  },
	  {
	    text: 'Yesterday',
	    value: () => {
	      const date = new Date()
	      date.setTime(date.getTime() - 3600 * 1000 * 24)
	      return date
	    },
	  },
	  {
	    text: 'A week ago',
	    value: () => {
	      const date = new Date()
	      date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
	      return date
	    },
	  },
	]	
	const disabledDate = (time: Date) => {
	  return time.getTime() > Date.now()
	}
	
	//修改数据
	let dialogVisible = ref(false)
	const handleClick = () => {
		dialogFormVisible='true'
		alert(dialogFormVisible)
	}	
	const dialogTableVisible = ref(false)
	let dialogFormVisible = ref(false)
	let dayDialogFormVisible = ref(false)
	let weekDialogFormVisible= ref(false)
	let monthDialogFormVisible= ref(false)
	let yearDialogFormVisible= ref(false)
	const formLabelWidth = '70px'	
		
	//细节数据分页
	const queryInfo = reactive(
		{
		query:"",
		// 当前页数
		pagenum:1,		
		//当前每页显示多少条数据
		pagesize:10,
		//总页数
		total:''
		}) 
	// 细节数据
	let tableData =ref("")
	getDetailData(queryInfo.pagenum).then(res =>{
		tableData.value = res.data.records,
		queryInfo.pagenum = res.data.current
		queryInfo.total = res.data.total
	})
		
	// 监听pagesize改变事件
	const handleSizeChange = (val: number) => {
	}
	//监听页码值改变事件
	const handleCurrentChange = (val: number) => {
	  getDetailData(queryInfo.pagenum).then(res =>{
	  	tableData.value = res.data.records
		queryInfo.pagesize = res.data.length
	  })
	}
	
	//细节数据按照日期查询
	const detailDayTime = ref("")
	
	const subGetDetailDayByTime = () =>{
		getDetailDataByTime(detailDayTime.value).then(res=>{		
			tableData.value = res.data
			queryInfo.pagenum = res.data.current
			queryInfo.pagesize = res.data.length
			queryInfo.total = 1
		})
	}
	//细节数据按照名称查询
	const detailDayHeader = ref("")
	
	const subGetDetailDayByName = () =>{
		getDetailDayByHeader(detailDayHeader.value).then(res=>{
			if (!res.data){
				ElMessage.error("未找到该负责人消息")
				return
			}
			tableData.value = res.data
			queryInfo.pagenum = res.data.current
			queryInfo.pagesize = res.data.length
			queryInfo.total = 1
		})
	}
	//细节数据修改
	const tableUpdateData = ref("")	
	const dialogGetInfor=(data)=>{
		tableUpdateData.value = data
	}
	const subDetailUpdate =()=>{
		updateDetailData(tableUpdateData.value).then(res=>{
			ElMessage.success("修改成功")
		})
	}
	
	//日账单
	//日账单数据分页
	const queryDayInfo = reactive(
		{
		query:"",
		// 当前页数
		pagenum:1,		
		//当前每页显示多少条数据
		pagesize:10,
		//总页数
		total:''
		}) 
	// 日账单数据
	let tableDayData =ref("")
	getDayData(queryDayInfo.pagenum).then(res =>{
		tableDayData.value = res.data.records,
		queryDayInfo.pagenum = res.data.current
		queryDayInfo.total = res.data.total
	})
	// 日监听页码值改变事件 分页
	const handleCurrentChangeByDay = (val: number) => {
	  getDayData(queryDayInfo.pagenum).then(res =>{
	  	tableDayData.value = res.data.records
		queryDayInfo.pagesize = res.data.length
	  })
	}	
	// 按时间查询
	const dayTime = ref("")
	
	const subGetDayByTime = () =>{
		getDayDataByTime(dayTime.value).then(res=>{		
			tableDayData.value = res.data
			queryDayInfo.pagenum = res.data.current
			queryDayInfo.pagesize = res.data.length
			queryDayInfo.total = 1
		})
	}
	//日数据修改
	const tableUpdateDayData = ref("")	
	const dialogGetDayInfor=(data)=>{
		tableUpdateDayData.value = data
	}
	const subDayUpdate =()=>{
		updateDayData(tableUpdateDayData.value).then(res=>{
			ElMessage.success("修改成功")
		})
	}

	//周账单
	//周账单数据分页
	const queryWeekInfo = reactive(
		{
		query:"",
		// 当前页数
		pagenum:1,		
		//当前每页显示多少条数据
		pagesize:10,
		//总页数
		total:''
		}) 
	// 周账单数据
	let tableWeekData =ref("")
	getWeekData(queryWeekInfo.pagenum).then(res =>{
		tableWeekData.value = res.data.records,
		queryWeekInfo.pagenum = res.data.current
		queryWeekInfo.total = res.data.total
	})
	// 日监听页码值改变事件 分页
	const handleCurrentChangeByWeek = (val: number) => {
	  getWeekData(queryWeekInfo.pagenum).then(res =>{
	  	tableWeekData.value = res.data.records
		queryWeekInfo.pagesize = res.data.length
	  })
	}	
	// 按时间查询
	const weekTime = ref("")	
	const subGetWeekByTime = () =>{
		getWeekDataByTime(weekTime.value).then(res=>{		
			tableWeekData.value = res.data
			queryWeekInfo.pagenum = res.data.current
			queryWeekInfo.pagesize = res.data.length
			queryWeekInfo.total = 1
		})
	}	
	
	//月账单	
	const queryMonthInfo = reactive(
		{
		query:"",
		// 当前页数
		pagenum:1,		
		//当前每页显示多少条数据
		pagesize:10,
		//总页数
		total:''
		}) 
	// 月账单数据
	let tableMonthData =ref("")
	getMonthData(queryMonthInfo.pagenum).then(res =>{
		tableMonthData.value = res.data.records,
		queryMonthInfo.pagenum = res.data.current
		queryMonthInfo.total = res.data.total
	})
	// 月监听页码值改变事件 分页
	const handleCurrentChangeByMonth = (val: number) => {
	  getMonthData(queryMonthInfo.pagenum).then(res =>{
	  	tableMonthData.value = res.data.records
		queryMonthInfo.pagesize = res.data.length
	  })
	}	
	// 按时间查询
	const monthTime = ref("")
	
	const subGetMonthByTime = () =>{
		console.log(monthTime.value)
		getMonthDataByTime(monthTime.value).then(res=>{		
			tableMonthData.value = res.data
			queryMonthInfo.pagenum = res.data.current
			queryMonthInfo.pagesize = res.data.length
			queryMonthInfo.total = 1
		})
	}
			
	//年账单	
	const queryYearInfo = reactive(
		{
		query:"",
		// 当前页数
		pagenum:1,		
		//当前每页显示多少条数据
		pagesize:10,
		//总页数
		total:''
		}) 
	// 年账单数据
	let tableYearData =ref("")
	getYearData(queryYearInfo.pagenum).then(res =>{
		tableYearData.value = res.data.records,
		queryYearInfo.pagenum = res.data.current
		queryYearInfo.total = res.data.total
	})
	// 年监听页码值改变事件 分页
	const handleCurrentChangeByYear = (val: number) => {
	  getYearData(queryYearInfo.pagenum).then(res =>{
	  	tableYearData.value = res.data.records
		queryYearInfo.pagesize = res.data.length
	  })
	}	
	// 按时间查询
	const yearTime = ref("")
	
	const subGetYearByTime = () =>{
		getYearDataByTime(yearTime.value).then(res=>{		
			tableYearData.value = res.data
			queryYearInfo.pagenum = res.data.current
			queryYearInfo.pagesize = res.data.length
			queryYearInfo.total = 1
		})
	}
	
	//细节插入
	const options = [
		{
		value: '1',
		label: '加权值1',
		},
		{
		value: '2',
		label: '加权值2',
		},
		{
		value: '3',
		label: '加权值3',
		}]
	const insertDetailDataForm = reactive({
		saleDetailDataId:"",
		detailTime:"",
		detailProjectName:"",
		detailProjectPice:"",
		detailProjectCost:"",
		detailProjectProfit:"",
		detailIsOk:"",
		detailProjectHeader:"",
		detailPlace :"",
		weight:''
	})
			
	const subDetailData=()=>{
		insertDetailData(insertDetailDataForm).then(res=>{
			ElMessage.success("插入成功")
		})
	}
	
	const insertDayDataForm = reactive({
		time:"",
		projectName:"",
		projectPice:"",
		projectCost:"",
		projectNumber:"",
		projectIncome:"",
		tax:"",
		note:""
	})
	const subDayData=()=>{
		insertDayData(insertDayDataForm).then(res=>{
			ElMessage.success("插入成功")
			location.reload()
		})
	}
	
	
	
</script>

<style scoped>
	.el-tab-pane{
		height: 100%;
	}
	:deep(.el-tabs__content){
		height: 90%;
	}
	:deep(.el-table__body-wrapper::-webkit-scrollbar){
		width: 0.1875rem;
		height: 0.300rem;
	}
	:deep(.el-table__body-wrapper::-webkit-scrollbar-thumb) {  /*滚动条里面小方块*/
	    border-radius: 10px;
	    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
	    background: #ebebeb;
	}
	:deep(.el-table__body-wrapper::-webkit-scrollbar-track) {  /*滚动条里面轨道*/
	    /* -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); */
	    border-radius: 10px;
	    background: #fff;
	}
	
	.input1{
		width: 12.5rem;
	}
	:deep(.cell){
		text-align: center;
	}
	
	@media screen and (max-width:48rem) {
		.input1{
			width:10rem;
			margin-top: 0.3125rem;
			font-size: 0.0625rem;
		}
	}
</style>